package cmd

import (
	"os"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestGetCryptoParams(t *testing.T) {
	os.Setenv(GitConfigParameters, "'agit.crypto.enabled=true' 'agit.crypto.secret=YC+bBhjF1XTIWLmu9w+c/6JnPIqn8PRpz3JOkuREXJU='")
	enabled, secret, salt := getCryptoParams()

	require.True(t, enabled)
	require.Equal(t, "YC+bBhjF1XTIWLmu9w+c/6JnPIqn8PRpz3JOkuREXJU=", secret)
	require.Empty(t, salt)
}
